﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Util.Applications;

namespace IterationLife.Football.MTSports.Dtos.Sports {
    /// <summary>
    /// 体育队伍数据传输对象
    /// </summary>
    [DataContract]
    public class SportTeamDto : DtoBase {
        /// <summary>
        /// 合作方队伍Id
        /// </summary>
        [Required(ErrorMessage = "合作方队伍Id不能为空")]
        [StringLength( 200, ErrorMessage = "合作方队伍Id输入过长，不能超过200位" )]
        [Display( Name = "合作方队伍Id" )]
        [DataMember]
        public string PartnerTeamId { get; set; }
        
        /// <summary>
        /// 名字
        /// </summary>
        [Required(ErrorMessage = "名字不能为空")]
        [StringLength( 50, ErrorMessage = "名字输入过长，不能超过50位" )]
        [Display( Name = "名字" )]
        [DataMember]
        public string Name { get; set; }
        
        /// <summary>
        /// 队标
        /// </summary>
        [StringLength( 500, ErrorMessage = "队标输入过长，不能超过500位" )]
        [Display( Name = "队标" )]
        [DataMember]
        public string Logo { get; set; }

        /// <summary>
        /// 人数
        /// </summary>
        [Display(Name = "人数")]
        [DataMember]
        public int PersonCount { get; set; }
        /// <summary>
        /// 历史平均数据
        /// </summary>
        [Display( Name = "历史平均数据" )]
        [DataMember]
        public string HistoryAverageJsonData { get; set; }
        
        /// <summary>
        /// 创建时间
        /// </summary>
        [Display( Name = "创建时间" )]
        [DataMember]
        public DateTime? CreationTime { get; set; }
        
        /// <summary>
        /// 创建人
        /// </summary>
        [Display( Name = "创建人" )]
        [DataMember]
        public Guid? CreatorId { get; set; }
        
        /// <summary>
        /// 最后修改时间
        /// </summary>
        [Display( Name = "最后修改时间" )]
        [DataMember]
        public DateTime? LastModificationTime { get; set; }
        
        /// <summary>
        /// 最后修改人
        /// </summary>
        [Display( Name = "最后修改人" )]
        [DataMember]
        public Guid? LastModifierId { get; set; }
        
        /// <summary>
        /// 是否删除
        /// </summary>
        [Required(ErrorMessage = "是否删除不能为空")]
        [Display( Name = "是否删除" )]
        [DataMember]
        public bool IsDeleted { get; set; }
        
        /// <summary>
        /// 版本号
        /// </summary>
        [Display( Name = "版本号" )]
        [DataMember]
        public Byte[] Version { get; set; }
        
        /// <summary>
        /// 输出体育队伍状态
        /// </summary>
        public override string ToString() {
            return this.ToEntity().ToString();
        }
    }
}
